/**
 * 
 */
package a0;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

/**
 * @author totyu
 *
 */
public class A0 {

    private static final String URL_7 = "/api/v1/refund";/* 3.7、退款指令 */
    private static final String URL_8 = "/api/v1/refundStatePull";/* 3.8、退款状态查询指令 */
    private static final String URL_9 = "/api/v1/refundStatePush";/* 3.9、退款状态推送 */
    private static final String URL_10 = "/api/v1/payToExchequer";/* 3.10、上缴国库指令 */
    private static final String URL_11 = "/api/v1/payToExchequerStatePull";/* 3.11、上缴状态查询指令 */

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Date dd = new Date();
        Instant ins = Instant.ofEpochMilli(dd.getTime());
        String yesterday = DateTimeFormatter.ofPattern("yyyyMMdd").withZone(ZoneId.systemDefault())
                .format(ins.minus(1, ChronoUnit.DAYS));

        System.out.println(yesterday);
        System.out.println(ins);

        List<String> ss = new ArrayList<>();
        ss.forEach(s -> {
            System.out.println(s);
        });

        Map<String, Object> mm = new HashMap<>();
        mm.put("1", "11");
        mm.put("2", "22");
        mm.put("3", "33");
        mm.forEach((k, v) -> {
            System.out.println(k + "::::" + v);
        });

        abc("456".concat("123"));

        String[] ssa = new String[] { URL_7, URL_8, URL_9 };
        boolean bl = ssa.equals(URL_7);

        System.out.println(new BigDecimal(new Random().nextInt(100000) + 10000 + Math.random())
                .setScale(2, RoundingMode.HALF_UP).toString());
        System.out.println(new BigDecimal(new Random().nextInt(100000) + 10000 + Math.random())
                .setScale(2, RoundingMode.HALF_UP).toString());
        System.out.println(new BigDecimal(new Random().nextInt(100000) + 10000 + Math.random())
                .setScale(2, RoundingMode.HALF_UP).toString());
        System.out.println(new BigDecimal(new Random().nextInt(100000) + 10000 + Math.random())
                .setScale(2, RoundingMode.HALF_UP).toString());
        System.out.println(new BigDecimal(new Random().nextInt(100000) + 10000 + Math.random())
                .setScale(2, RoundingMode.HALF_UP).toString());
        System.out.println(new BigDecimal(new Random().nextInt(100000) + 10000 + Math.random())
                .setScale(2, RoundingMode.HALF_UP).toString());

        System.out.println(Math.random() * (3 - 1) + 1 < 2);
        System.out.println(Math.random() * (3 - 1) + 1 < 2);
        System.out.println(Math.random() * (3 - 1) + 1 < 2);
        System.out.println(Math.random() * (3 - 1) + 1 < 2);
        System.out.println(Math.random() * (3 - 1) + 1 < 2);
    }

    private static void abc(String abc) {
        System.out.println(abc);
    }

}
